package com.iot.compont;

import com.iot.http.HttpServerNetwork;
import com.iot.mqtt.MqttServerNetwork;
import com.iot.socket.SoketServerNetwork;
import com.iot.tcp.TcpServerNetwork;

/**
 * 根据枚举值获取指定的 服务端
 *
 * @author Administrator
 */

public enum GatewayServerEnum {

    HTTP(new HttpServerNetwork()),

    SOCKET(new SoketServerNetwork()),
    MQTT(new MqttServerNetwork()),
    TCP(new TcpServerNetwork());


    ServerNetwork serverNetwork;

    GatewayServerEnum(ServerNetwork serverNetwork) {
        this.serverNetwork = serverNetwork;
    }

    public ServerNetwork createServerNetworkByName() {

        return serverNetwork;
    }
}
